#ifndef TCPCONNECTION_H
#define TCPCONNECTION_H
#include <QObject>
#include <QDebug>
#include "tcpserver.h"
#include "message.h"

class TcpConnection : public QObject
{
    Q_OBJECT
signals:
    //void receivedStart(QByteArray);
    void receivedStart(DiscData);
    void receivedStop();
    void acceptedConnection();
    void receivedSearchMovieData(MovieData);
    void receivedSearchTitleDiscData(DiscData);
public slots:
    void receivedMessage(QByteArray message);

    void sendReady();
    void sendDone();
    void sendWorking();
    void sendIdle();
    void sendProgress(int progress);
    void acceptConnection();
    void sendDiscData(QList<DiscData> discData);
    void sendMovieData(QList<MovieData> movieData);
    void sendMovieDataUnknown();
    void sendDiscDataUnknown();
    void sendCanceled();


public:
    TcpConnection(QObject *parent=0);
    ~TcpConnection();
private:
    TcpServer* _server;

    void sendMessage(QByteArray data);
};

#endif // TCPCONNECTION_H
